import hashlib
import uuid
from django.conf import settings


def md5(str):
    '''
    md5加密
    :param str:
    :return:
    '''
    hashobj = hashlib.md5(settings.SECRET_KEY.encode('utf8'))
    hashobj.update(str.encode('utf8'))
    return hashobj.hexdigest()

def uid(filename):
    name=f'{filename}-{str(uuid.uuid4())}'
    return md5(name)
